import { createBrowserRouter, Navigate } from 'react-router-dom'
import AuthRoute from '@/components/AuthRoute'

import Layout from '@/pages/layout'
import Login from '@/pages/login'
import Home from '@/pages/home'
const router = [
  {
    path: '/',
    element: (
      <AuthRoute>
        <Layout></Layout>
      </AuthRoute>
    ),
    children: [
      {
        path: '/',
        element: <Navigate to="/home"></Navigate>
      },
      {
        path: 'home',
        element: <Home></Home>
      },
      {
        path: 'article',
        element: <Home></Home>
      }
    ]
  },
  {
    path: '/login',
    element: <Login></Login>
  }
]

export default createBrowserRouter(router)
